home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM15_A.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  5KB  |  92 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM15_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_context                                             ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function saves the mapping context for all         ;
  7. ;                     mappable memory regions (conventional and expanded) by  ;
  8. ;                     copying the contents of the mapping hardware from each  ;
  9. ;                     expanded memory board to a destination structure.  The  ;
  10. ;                     application must pass a pointer to the destination      ;
  11. ;                     structure.  This function doesn't require an EMM        ;
  12. ;                     handle.                                                 ;
  13. ;                                                                             ;
  14. ;                     Use this function instead of save_context &             ;
  15. ;                     restore_context if you need to save or restore the      ;
  16. ;                     mapping context but don't want to (or have to) use a    ;
  17. ;                     handle.                                                 ;
  18. ;                                                                             ;
  19. ;           PASSED:   &dest_context:                                          ;
  20. ;                        is a far pointer to the destination structure of the ;
  21. ;                        mapping context to be saved.                         ;
  22. ;                                                                             ;
  23. ;         RETURNED:   status:                                                 ;
  24. ;                        is the status EMM returns from the call.  All other  ;
  25. ;                        returned results are valid only if the status        ;
  26. ;                        returned is zero.  Otherwise they are undefined.     ;
  27. ;                                                                             ;
  28. ;                     dest_context:                                           ;
  29. ;                        is a structure containing the state of all the       ;
  30. ;                        mapping hardware on all boards in the system.  It    ;
  31. ;                        also contains any additional information necessary   ;
  32. ;                        to restore the boards to their original state when   ;
  33. ;                        the program invokes a set_context or get_set_context ;
  34. ;                        function.                                            ;
  35. ;                        The structure member is described here:              ;
  36. ;                                                                             ;
  37. ;                        dest_context.reserved:                               ;
  38. ;                           is a character array that is used to store the    ;
  39. ;                           state.                                            ;
  40. ;                                                                             ;
  41. ; C USE CONVENTION:   unsigned int   status;                                  ;
  42. ;                     CONTEXT_STRUCT dest_context;                            ;
  43. ;                                                                             ;
  44. ;                     status = get_context (&dest_context);                   ;
  45. ;-----------------------------------------------------------------------------;
  46. .XLIST
  47. PAGE    60,132
  48.  
  49. IFDEF SMALL
  50.    .MODEL SMALL, C
  51. ENDIF
  52. IFDEF MEDIUM
  53.    .MODEL MEDIUM, C
  54. ENDIF
  55. IFDEF LARGE
  56.    .MODEL LARGE, C
  57. ENDIF
  58. IFDEF COMPACT
  59.    .MODEL COMPACT, C
  60. ENDIF
  61. IFDEF HUGE
  62.    .MODEL HUGE, C
  63. ENDIF
  64.  
  65. INCLUDE emmlib.equ
  66. INCLUDE emmlib.str
  67. INCLUDE emmlib.mac
  68. .LIST
  69. .CODE
  70.  
  71. get_context        PROC                                                  \
  72.             USES DI,                                              \
  73.             ptr_dest_context:FAR PTR BYTE
  74.  
  75.     ;---------------------------------------------------------------------;
  76.     ;   do;                                                               ;
  77.     ;   .   get the current memory mapping context from EMM;              ;
  78.     ;---------------------------------------------------------------------;
  79.     MOVE        AX, get_page_map_fcn
  80.     MOVE        ES:DI, ptr_dest_context
  81.     INT         EMM_int
  82.  
  83.     ;---------------------------------------------------------------------;
  84.     ;   .   return (EMM status);                                          ;
  85.     ;   end;                                                              ;
  86.     ;---------------------------------------------------------------------;
  87.     RET_EMM_STAT    AH
  88.  
  89. get_context        ENDP
  90.  
  91. END
  92.